<?php
/*
 *
 * @authors : IT123编程社区-mastudy
 * @email  :admin@it123.org
 * @bbs http://www.it123.org
 *  @link http://www.it123.org
 *  @Powered By  ©2016 www.it123.org[IT123编程社区]
 */
// 本类由系统自动生成，仅供测试用途
class BlogAction extends PublicAction {

    public function _initialize() {

                              $this->assign('volunteerList', $this->getMemberList(10));  
    }

    public function index() {

        $nickname = $this->_get('name');



//用户信息
        
        $mDB=M('member_basic');
        
      
        
        $where_member['member_nickname']=$nickname;
        
        
        $blogerinfo=$mDB->where($where_member)->find();
        
        
        if(!$blogerinfo){
                
                $this->error('无此用户！');
                
        }
        
        
       
        
        
        
        $blogerinfo['bloger_face50']=  ToolsAction::getUserFace($blogerinfo['member_id'], '50');
        
          $blogerinfo['bloger_info']=  ToolsAction::getUserFace($blogerinfo['member_id'], '50');
        
        
        $this->assign('blogerinfo',$blogerinfo);
        
        
        
        
        
        
        //用户文章信息


        $articleDB = M('article');
        $where_article['article_author_id'] =$blogerinfo['member_id'];
        $where_article['article_ispubish'] = 1;
        $where_article['article_verifystatus'] = 1;
        $where_article['article_show'] = 1;

        $article_lists = $articleDB->where($where_article)->order('article_addtime DESC')->limit(10)->select();




        $article_lists = ToolsAction::resetArticleList($article_lists);
        
        
        

        $this->assign('article_lists', $article_lists);



        //用户问答信息


        $askDB = M('ask');
        $where_ask['ask_author_id'] =$blogerinfo['member_id'];
        $where_ask['ask_ispubish'] = 1;
        $where_ask['ask_verifystatus'] = 1;
        $where_ask['ask_show'] = 1;

        $ask_lists = $askDB->where($where_ask)->order('ask_addtime DESC')->limit(10)->select();




        $ask_lists = ToolsAction::resetAskList($ask_lists);
        
        
        

        $this->assign('ask_lists', $ask_lists);

 //用户帖子信息


        $topicDB = M('group_topic');
        $where_topic['topic_uid'] =$blogerinfo['member_id'];
  
        $where_topic['topic_verifystatus'] = 1;


        $topic_lists = $topicDB->where($where_topic)->order('topic_time DESC')->limit(10)->select();




        $topic_lists = ToolsAction::resetTopicList($topic_lists);
        
        
        

        $this->assign('topic_lists', $topic_lists);
        
        
        $this->assign('uid',$blogerinfo['member_id']);
        
        cookie('LURL', __SELF__);

        $this->display();
    }

    
    
    
    

}
